﻿<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
   

<h1>New Car | Добавление автомобиля в список:  </h1>
 


<form:form action="${action}" commandName="car" modelAttribute="car" method="POST">

	<form:errors path="*" cssClass="errorblock" element="div" />
	
	<form:input path="carBrand" /> <form:errors path="carBrand" cssClass="error" /> <br/>
	<form:input path="stateNumber" /> <form:errors path="stateNumber" cssClass="error" /> <br/>
        <form:input path="color" /> <form:errors path="color" cssClass="error" /> <br/>
        <form:label path="priceOfRentPer24Hours">Price of 24h-rent | Цена за 1 сутки аренды:</form:label> 
        <form:input path="priceOfRentPer24Hours" /> <form:errors path="priceOfRentPer24Hours" cssClass="error" /> <br/>
	
	<c:if test="${car.carId > 0}" >
	<form:label path="carId">ID1:</form:label>
	<form:hidden path="carId" /> ${car.carId} <br/><br/>
	</c:if>
	
	<c:if test="${car.carId == 0}" >
	  <form:label path="carId">ID:</form:label> <form:input path="carId"/>
	  <form:errors path="carId"/> <br/><br/>
    </c:if>	  
			
	<input type="submit" value="Save | Сохранить" />
	<input type="reset" value="Cancel | Отмена" onclick="window.history.back();"/>
  
</form:form> 
